package com.wujunshen.rest.config;

import com.wujunshen.core.service.IdService;
import com.wujunshen.core.service.impl.IdServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Slf4j
@Configuration
public class BeanServiceConfig {

    @Value("${generate.worker}")
    private String worker;

    @Bean
    public IdService idService() {
        log.info("worker id is :{}", worker);
        return new IdServiceImpl(Long.parseLong(worker));
    }

}
